package com.example.haojiutao.controller.user;

import com.example.haojiutao.common.Result;
import com.example.haojiutao.model.domain.GoodsBanner;
import com.example.haojiutao.service.GoodsBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: 商品轮播图控制器
 * @Author: ma_jun
 * @CreateTime: 2023/12/12 15:12
 */
@RequestMapping("/goods/banner")
@RestController("GoodsBannerController")
public class GoodsBannerController {
    @Autowired
    private GoodsBannerService goodsBannerService;
    /**
     * @Description: TODO 获取商品轮播图列表接口
     * @Author: ma_jun
     * @CreateTime: 2023/12/12 15:20
     * @return: Result
     **/
    @GetMapping("/{goodsId}")
    public Result listById(@PathVariable Integer goodsId){
        List<GoodsBanner> goodsBanner = goodsBannerService.selectById(goodsId);
        return Result.success("查询成功",goodsBanner);
    }
}
